﻿using CleanLite.Domain.Interfaces;
using CleanLite.DynamicApi;
using Microsoft.AspNetCore.Mvc;

namespace CleanLite.Application.Services.Base
{
    /// <summary>
    /// 动态API基类，实现属性注入Repository
    /// </summary>
    ///<remarks>
    ///继承此类可以无需构造函数注入仓储,而是属性注入Repository达到直接使用的目的
    /// </remarks>
    /// <typeparam name="T"></typeparam>
    public abstract class BaseService<T> : IDynamicApi where T : class
    {
        [FromServices]
        public IBaseRepository<T> Repository { get; set; }
    }
}